package com.jian.cms.util.interceptors.admin;

import java.util.Map;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class CssAndJsManager extends AbstractInterceptor {
    private String cssPath;
    private String jsPath;
    
    public String getCssPath() {
        return cssPath;
    }

    public void setCssPath(String cssPath) {
        this.cssPath = cssPath;
    }

    public String getJsPath() {
        return jsPath;
    }

    public void setJsPath(String jsPath) {
        this.jsPath = jsPath;
    }

    @SuppressWarnings("unchecked")
    @Override
    public String intercept(ActionInvocation ai) throws Exception {
        System.out.print("test");
        Map session = ai.getInvocationContext().getSession();  
        if(session.get("cssPath") != null && cssPath != null)
        {
            session.put("cssPath", cssPath);
        }
        if(session.get("jsPath") != null && cssPath != null)
        {
            session.put("jsPath", cssPath);
        }
        return ai.invoke();
    }

}
